package javabase.concurrent;

public class JavaThreadAnywhere {

    public static void main(String[] args) {
        System.out.println("main is executed by " + Thread.currentThread().getName());
        Helper helper = new Helper("JavaThreadAnywhere");
        helper.run();
    }

    static class Helper implements Runnable {

        private final String message;

        public Helper(String message) {
            this.message = message;
        }

        @Override
        public void run() {
            System.out.println("helper is executed by " + Thread.currentThread().getName());
            System.out.println("helper with message " + message);
        }
    }

}
